Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Raw • Download


Dockerfile 02c2f1d09ac00acf8602a2fd4ee8eff3724f84a4 (02c2f1d0) Text, 2.58 KB

Tff7b72ARG Te6edf3NODE_IMAGETff7b72=node:22-alpine
Tff7b72ARG Te6edf3NODE_HASHTff7b72=sha256:0340fa682d72068edf603c305bfbc10e23219fb0e40df58d9ea4d6f33a9798bf
Tff7b72ARG Te6edf3PYTHON_IMAGETff7b72=python:3.12.12-alpine3.23
Tff7b72ARG Te6edf3PYTHON_HASHTff7b72=sha256:68d81cd281ee785f48cdadecb6130d05ec6957f1249814570dc90e5100d3b146

T8b949e# Stage 1: Build Frontend
Tff7b72FROM Ta5d6ff${NODE_IMAGE}@${NODE_HASH} Tff7b72AS Ta5d6ffbuild-frontend
Tff7b72WORKDIR Ta5d6ff/src
Tff7b72COPY package.json pnpm-lock.yaml vite.config.js tailwind.config.js postcss.config.js ./
Tff7b72COPY meshchatx/src/frontend ./meshchatx/src/frontend
Tff7b72RUN corepack Tffa657enable Tff7b72&& corepack prepare pnpm@latest --activate Tff7b72&& Tffea00\
pnpm install --frozen-lockfile Tff7b72&& Tffea00\
pnpm run build-frontend

T8b949e# Stage 2: Build Backend & Virtual Environment
Tff7b72FROM Ta5d6ff${PYTHON_IMAGE}@${PYTHON_HASH} Tff7b72AS Ta5d6ffbuilder
Tff7b72WORKDIR Ta5d6ff/build
T8b949e# Install build dependencies for C-extensions
Tff7b72RUN apk add --no-cache gcc musl-dev linux-headers python3-dev libffi-dev openssl-dev git
T8b949e# Setup venv and install dependencies
Tff7b72RUN python -m venv /opt/venv
Tff7b72ENV Te6edf3PATHTff7b72=Ta5d6ff"Ta5d6ff/opt/venv/bin:Te6edf3$PATHTa5d6ff"
Tff7b72COPY pyproject.toml poetry.lock ./
Tff7b72RUN pip install --no-cache-dir Ta5d6ff"pip>=25.3" poetry setuptools wheel Ta5d6ff"jaraco.context>=6.1.0" Tff7b72&& Tffea00\
poetry config virtualenvs.create Tffa657false Tff7b72&& Tffea00\
poetry install --no-root --only main

T8b949e# Copy source code and built frontend
Tff7b72COPY meshchatx ./meshchatx
Tff7b72COPY --fromTff7b72=build-frontend /src/meshchatx/public ./meshchatx/public

T8b949e# Install the package itself into the venv
Tff7b72RUN pip install . Tff7b72&& Tffea00\
# Trigger LXST filter compilation Tff7b72while build tools are still present
python -c Ta5d6ff"import LXST.Filters; print('LXST Filters compiled successfully')" Tff7b72&& Tffea00\
python -m compileall /opt/venv/lib/python3.12/site-packages

T8b949e# Stage 3: Final Runtime Image
Tff7b72FROM Ta5d6ff${PYTHON_IMAGE}@${PYTHON_HASH}
Tff7b72WORKDIR Ta5d6ff/app
T8b949e# Install runtime dependencies only
T8b949e# We keep py3-setuptools because CFFI/LXST might need it at runtime on Python 3.12+
Tff7b72RUN apk add --no-cache ffmpeg opusfile libffi su-exec py3-setuptools espeak-ng Tff7b72&& Tffea00\
python -m pip install --no-cache-dir --upgrade Ta5d6ff"pip>=25.3" Ta5d6ff"jaraco.context>=6.1.0" Tff7b72&& Tffea00\
addgroup -g T79c0ff1000 meshchat Tff7b72&& adduser -u T79c0ff1000 -G meshchat -S meshchat Tff7b72&& Tffea00\
mkdir -p /config Tff7b72&& chown meshchat:meshchat /config

T8b949e# Copy the virtual environment from the build stage
Tff7b72COPY --fromTff7b72=builder --chownTff7b72=meshchat:meshchat /opt/venv /opt/venv

T8b949e# Set up environment
Tff7b72ENV Te6edf3PATHTff7b72=Ta5d6ff"Ta5d6ff/opt/venv/bin:Te6edf3$PATHTa5d6ff"
Tff7b72ENV Te6edf3PYTHONUNBUFFEREDTff7b72=T79c0ff1
Tff7b72ENV Te6edf3PYTHONDONTWRITEBYTECODETff7b72=T79c0ff1

T8b949e# Run the app using the installed 'meshchat' entrypoint
Tff7b72CMD Tb4b4b4[Ta5d6ff"sh"Tb4b4b4, Ta5d6ff"-c"Tb4b4b4, Ta5d6ff"chown -R meshchat:meshchat /config && exec su-exec meshchat meshchat --host=0.0.0.0 --reticulum-config-dir=/config/.reticulum --storage-dir=/config/.meshchat --headless"Tb4b4b4]


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────